

Component({
    properties: {
        item: {
            type: Object,
            observer: function(t, i) {
                var o = this;
                if (t.praisecount || 0 === t.praisecount) if (t.praisecount > 1e3) {
                    var r = (t.praisecount / 1e3).toFixed(1) + "k";
                    o.setData({
                        "item.showPraisecount": r
                    });
                } else o.setData({
                    "item.showPraisecount": t.praisecount
                });
                if (t.image && t.image.url) {
                    var a = e(t.image.url, "side", 350);
                    o.setData({
                        "item.image.url": a
                    });
                }
            }
        }
    },
    data: {
        selected: !1
    },
    detached: function() {
        var e = this;
        e.highObserver.disconnect(), e.lowObserver.disconnect();
    },
    ready: function() {
      
    },
    methods: {
    
        clickLike: function() {
            var e = this;
            if (!e.data.selected && !e.data.item.selected) {
                var t = null;
                t = e.data.item.praisecount > 1e3 ? ((e.data.item.praisecount + 1) / 1e3).toFixed(1) + "k" : e.data.item.praisecount + 1, 
                e.setData({
                    selected: !0,
                    "item.showPraisecount": t
                });
                var i = wx.getStorageSync("like-list") ? wx.getStorageSync("like-list") : [];
                i.indexOf(e.data.item.resourceid) < 0 && i.push(e.data.item.resourceid), wx.setStorageSync("like-list", i);
            }
        }
    }
});